package org.eiahe.hr.salary.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import org.ehe.common.core.validate.AddGroup;
import org.ehe.common.core.validate.EditGroup;
import org.ehe.common.mybatis.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.eiahe.hr.salary.domain.SalaryStatistics;
import org.eiahe.hr.salary.domain.SalaryStructure;

import java.math.BigDecimal;

/**
 * 薪资构成业务对象 hr_salary_structure
 *
 * @author zhangnn
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = SalaryStructure.class, reverseConvertGenerate = false)
public class SalaryStructureBo extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 薪资构成ID
     */
    @NotNull(message = "薪资构成ID不能为空", groups = { EditGroup.class })
    private Long structureId;

    /**
     * 租户ID
     */
    private String tenantId;

    /**
     * 工号
     */
    @NotBlank(message = "工号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String employeeNo;

    /**
     * 员工姓名
     */
    @NotBlank(message = "员工姓名不能为空", groups = { AddGroup.class, EditGroup.class })
    private String employeeName;

    /**
     * 银行卡号
     */
    private String bankCardNo;

    /**
     * 开户行
     */
    private String bankName;

    /**
     * 部门
     */
    private String department;

    /**
     * 年月(yyyyMM格式)
     */
    @NotBlank(message = "年月不能为空", groups = { AddGroup.class, EditGroup.class })
    @Pattern(regexp = "\\d{6}", message = "年月格式不正确，请使用yyyyMM格式")
    private String yearMonth;

    /**
     * 职工级别
     */
    private String jobLevelSalary;

    /**
     * 基本工资
     */
    private BigDecimal baseSalary;

    /**
     * 岗位工资
     */
    private BigDecimal positionSalary;

    /**
     * 绩效工资
     */
    private BigDecimal performanceSalary;

    /**
     * 职务津贴
     */
    private BigDecimal dutyAllowance;

    /**
     * 应出勤天数
     */
    private Integer shouldAttendanceDays;

    /**
     * 缺勤天数
     */
    private Integer absenceDays;

    /**
     * 计薪出勤天数
     */
    private Integer paidAttendanceDays;

    /**
     * 缺勤扣款
     */
    private BigDecimal absenceDeduction;

    /**
     * 误餐补助
     */
    private BigDecimal mealAllowance;

    /**
     * 其他调整(扣款-/奖金+/其他)
     */
    private BigDecimal otherAdjustment;

    /**
     * 餐费扣款
     */
    private BigDecimal mealDeduction;

    /**
     * 应发合并
     */
    private BigDecimal grossSalary;

    /**
     * 养老扣款
     */
    private BigDecimal pensionDeduction;

    /**
     * 失业扣款
     */
    private BigDecimal unemploymentDeduction;

    /**
     * 医疗扣款
     */
    private BigDecimal medicalDeduction;

    /**
     * 大额医疗扣款
     */
    private BigDecimal majorMedicalDeduction;

    /**
     * 社保个人扣款
     */
    private BigDecimal socialInsurancePersonal;

    /**
     * 公积金扣款
     */
    private BigDecimal housingFundPersonal;

    /**
     * 社保公积金合计
     */
    private BigDecimal socialHousingTotal;

    /**
     * 税前工资
     */
    private BigDecimal taxableSalary;

    /**
     * 个人所得税
     */
    private BigDecimal personalTax;

    /**
     * 实发工资
     */
    private BigDecimal netSalary;

    /**
     * 状态(0正常 1封存)
     */
    private String status;

    /**
     * 数据来源(1导入 2调薪 3冲减 4修正)
     */
    private String dataSource;
}
